package com.example.chuntiao.cophook.beans;

/**
 * Created by chuntiao on 17-7-17.
 */

public class Person {
    private String uid;
    private String name;
    private String phone1;
    private String phone2;
    private boolean imgDownLodCompleted;
    private String PyOfHomeName;
    String locate;

    private int imgVer;


    public int getImgVer() {
        return imgVer;
    }

    public void setImgVer(int imgVer) {
        this.imgVer = imgVer;
    }


    public String getUid() {
        return uid;
    }

    public Person() {
        imgDownLodCompleted = false;
        phone2 = "";
    }

    public Person(String uid) {
        this.uid = uid;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof PersonHideDataSupport)
            return uid.equals(((PersonHideDataSupport) obj).getUid());
        else if (obj instanceof Person) {
            Person tPerson = (Person) obj;
            if (tPerson.getUid() == null) {
                return uid == null && tPerson.getPyOfHomeName().equals(PyOfHomeName) ;
            } else {
                return uid != null && uid.equals(tPerson.getUid());
            }
        } else
            return uid.equals(((PersonDataSupport) obj).getUid());
    }

    public Person(PersonDataSupport data) {
        this.uid = data.getUid();
        this.name = data.getName();
        this.phone1 = data.getPhone1();
        this.phone2 = data.getPhone2();
        this.PyOfHomeName = data.getPyOfHomeName();
        this.locate = data.getLocate();
        this.imgVer = data.getImgVer();
    }

    public Person(PersonHideDataSupport data) {
        this.uid = data.getUid();
        this.name = data.getName();
        this.phone1 = data.getPhone1();
        this.phone2 = data.getPhone2();
        this.PyOfHomeName = data.getPyOfHomeName();
        this.locate = data.getLocate();
        this.imgVer = data.getImgVer();
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public boolean isImgDownLodCompleted() {
        return imgDownLodCompleted;
    }

    public void setImgDownLodCompleted(boolean imgDownLodCompleted) {
        this.imgDownLodCompleted = imgDownLodCompleted;
    }

    public String getPhone1() {
        return phone1;
    }

    public void setPhone1(String phone1) {
        this.phone1 = phone1;
    }

    public String getPhone2() {
        return phone2;
    }

    public void setPhone2(String phone2) {
        this.phone2 = phone2;
    }


    public String getPyOfHomeName() {
        return PyOfHomeName;
    }

    public void setPyOfHomeName(String pyOfHomeName) {
        PyOfHomeName = pyOfHomeName;
    }

    public String getLocate() {
        return locate;
    }

    public void setLocate(String locate) {
        this.locate = locate;
    }
}
